﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
    public class PHIEUNHAP_BUSSINESS
    {
        public DataSet ListPHIEUNHAP(PHIEUNHAP_ENTITY hx)
        {
            string ACTION = "LIST";
            return PHIEUNHAP_DATAACCESS.GETDATATABLE(ACTION, hx);
        }
        public DataSet TTPHIEUNHAP(PHIEUNHAP_ENTITY hx)
        {
            string ACTION = "GETBYID";
            return PHIEUNHAP_DATAACCESS.GETDATATABLE(ACTION, hx);
        }
        public int GetMAXID(PHIEUNHAP_ENTITY hx)
        {
            string ACTION = "MAXID";
            return PHIEUNHAP_DATAACCESS.MAXID(ACTION, hx);
        }
        public void ThemPHIEUNHAP(PHIEUNHAP_ENTITY hx)
        {
            string ACTION = "INSERT";
            PHIEUNHAP_DATAACCESS.ExcuteQueryString(ACTION, hx);
        }
        public void SuaPHIEUNHAP(PHIEUNHAP_ENTITY hx)
        {
            string ACTION = "UPDATE";
            PHIEUNHAP_DATAACCESS.ExcuteQueryString(ACTION, hx);
        }
        public void LuuPHIEUNHAP(PHIEUNHAP_ENTITY hx)
        {
            string ACTION = "SAVE";
            PHIEUNHAP_DATAACCESS.ExcuteQueryString(ACTION, hx);
        }
        public void XoaPHIEUNHAP(PHIEUNHAP_ENTITY hx)
        {
            string ACTION = "DELETE";
            PHIEUNHAP_DATAACCESS.ExcuteQueryString(ACTION, hx);
        }
        public Hashtable HashListPHIEUNHAP(PHIEUNHAP_ENTITY ot)
        {
            string ACTION = "LIST";
            Hashtable ht = new Hashtable();
            DataSet ds = PHIEUNHAP_DATAACCESS.GETDATATABLE(ACTION, ot);
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    ht.Add(dr["SOPN"], dr["SOPN"]);
                }
            }
            return ht;
        }
        public DataSet Web_LoadGia(string maxe)
        {
            string ACTION = "DONGIAWEB";
           return PHIEUNHAP_DATAACCESS.GETDATAGIABAN(ACTION, maxe);
        }
    }
